<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script src="./echarts.js"></script>
</head>

<body>
    <div style="width: 100%;height:800px" id="main"></div>
</body>

</html>
<script>
    let main = document.querySelector('#main')
    let obj = echarts.init(main)
    let option = {
        title: {
            text: '雷达图'
        },
        // 只适用于雷达图
        radar: [
            {
                // 圆形
                shape: 'circle',
                // 雷达图的指示器，用来指示雷达图里多个变量
                indicator: [
                    {
                        name: '蔬菜', max: 6500
                    },
                    {
                        name: '水果', max: 16000
                    },
                    {
                        name: '熟食', max: 30000
                    },
                    {
                        name: '数码', max: 38000
                    },
                    {
                        name: '家电', max: 52000
                    },
                    {
                        name: '日化', max: 25000
                    },
                ],
                // 雷达图的半径
                radius: 80,
                // 坐标系的起始角度
                starAngle: 180,
                splitnumber: 4,
                // 标签字体的颜色
                axisName: {
                    formatter: '{value}',
                    color: '#428BD4'
                },
                // 设置分割区域效果
                splitArea: {
                    // 填充的颜色
                    areaStyle: {
                        color: ['#77EADE', '26C3BE', '#64AFE9', '#428BD'],
                        shadowColor: 'rgba(0, 0, 0, 0.5)',
                        shadowBlur: 10
                    }
                }

            }
        ],
        series: [
            {
                // 雷达图
                type: 'radar',
                data: [
                    {
                        value: [4200, 5300, 6666, 2345, 1234, 4567]
                    }
                ],
                // 线条的效果
                lineStyle:{ 
                    // 虚线
type:'dashed'
                }
            }
        ]
    }
    obj.setOption(option)
</script>